package com.xxx.host;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.yunjing.v20180228.YunjingClient;
import com.tencentcloudapi.yunjing.v20180228.models.DeleteMalwaresRequest;
import com.tencentcloudapi.yunjing.v20180228.models.DeleteMalwaresResponse;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeAgentVulsRequest;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeAgentVulsResponse;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeMalwaresRequest;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeMalwaresResponse;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeVulInfoRequest;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeVulInfoResponse;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeVulScanResultRequest;
import com.tencentcloudapi.yunjing.v20180228.models.DescribeVulScanResultResponse;
import com.tencentcloudapi.yunjing.v20180228.models.RecoverMalwaresRequest;
import com.tencentcloudapi.yunjing.v20180228.models.RecoverMalwaresResponse;
import com.tencentcloudapi.yunjing.v20180228.models.TrustMalwaresRequest;
import com.tencentcloudapi.yunjing.v20180228.models.TrustMalwaresResponse;

import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JLabel;

public  class DescribeAgentVulstest extends JFrame implements ActionListener{

	private JPanel contentPane;
	private JTextField text;
	protected char[] strJSON;
	private JButton jb;
	private JLabel lblNewLabel;
	/**
	 * Launch the application.
	 */
	  
	
	
	public DescribeAgentVulstest()  {
		setBackground(new Color(240, 240, 240));
	    this.setTitle("获取单台主机漏洞列表");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(500, 500, 1250, 700);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		jb=new JButton("确定");
		jb.setBounds(5, 610, 1218, 29);
		getContentPane().add(jb);
		jb.addActionListener(this);//加入事件监听
		this.setVisible(true);
		
		text = new JTextField();
		text.setBounds(40, 101, 1183, 509);
		text.setFont(new Font("宋体", Font.BOLD, 25));
		

	            Credential cred = new Credential("AKIDUnsFb9FgYdWtthycgUYO3dBXMzLXpkhR", "rY2oN5XlmoW1oNRJwLceSVL1Un7Geuym");
	            
	            HttpProfile httpProfile = new HttpProfile();
	            httpProfile.setEndpoint("yunjing.tencentcloudapi.com");

	            ClientProfile clientProfile = new ClientProfile();
	            clientProfile.setHttpProfile(httpProfile);            
	            
	            YunjingClient client = new YunjingClient(cred, "", clientProfile);
	            
	            String params = "{\"VulType\":\"WEB\",\"Uuid\":\"c5e40a60-5ff5-11e9-a175-5cb9019b3cb0\"}";;
	            DescribeAgentVulsRequest req = DescribeAgentVulsRequest.fromJsonString(params, DescribeAgentVulsRequest.class);
	            
	            DescribeAgentVulsResponse resp = null;
				try {
					resp = client.DescribeAgentVuls(req);
				} catch (TencentCloudSDKException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	            
	            String strJSON=DescribeAgentVulsRequest.toJsonString(resp);

	      
	
		 text.setText(String.valueOf(strJSON));
		contentPane.add(text);
		text.setColumns(10);
		
	}
	/**
	 * Create the frame.
	 *
	 */
	public static void main(String [] args) {
	    	
		DescribeAgentVulstest frame = new DescribeAgentVulstest();
		 frame.setVisible(true);
					
				


			

	    }
	    
	


	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource()==jb)
		{
		this.dispose();
		
		}
		
	}
}
		

		
					
				
			
		
		




